import request from '@/utils/request'
// 查询站点下拉树结构
export function genSiteCode(site) {
  return request({
    url: '/biz/site/genSiteCode',
    method: 'get',
    params: site
  })
}


// 查询站点下拉树结构
export function treeselect() {
  return request({
    url: '/biz/site/treeSelect',
    method: 'get'
  })
}

// 站点状态修改
export function changeSiteStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/biz/site/changeSiteStatus',
    method: 'put',
    data: data
  })
}

// 查询站点列表
export function listSite(query) {
  return request({
    url: '/biz/site/list',
    method: 'get',
    params: query
  })
}

// 查询站点详细
export function getSite(id) {
  return request({
    url: '/biz/site/' + id,
    method: 'get'
  })
}

// 新增站点
export function addSite(data) {
  return request({
    url: '/biz/site',
    method: 'post',
    data: data
  })
}

// 修改站点
export function updateSite(data) {
  return request({
    url: '/biz/site',
    method: 'put',
    data: data
  })
}

// 删除站点
export function delSite(id) {
  return request({
    url: '/biz/site/' + id,
    method: 'delete'
  })
}

// 导出站点
export function exportSite(query) {
  return request({
    url: '/biz/site/export',
    method: 'get',
    params: query
  })
}

// 获取所有站点
export function selectSiteList(query) {
  return request({
    url: '/biz/site/selectSiteList',
    method: 'get'
  })
}

export function selectListBySite(){
  return request({
    url: '/biz/site/selectListBySite',
    method: 'get'
  })
}
